@import '/variable.less';

.activity-container {
  min-height: 100vh;
  background: #FAF8F3;
  padding-bottom: 100px;
}

/* 顶部导航栏 */
.top-navbar {
  position: sticky;
  top: 0;
  z-index: 100;
  background: #FAF8F3;
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid rgba(0, 0, 0, 0.05);

  .nav-title {
    font-size: 18px;
    font-weight: bold;
    color: #333333;
  }

  .nav-history {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.8);
    transition: all 0.3s ease;

    &:active {
      background: rgba(0, 0, 0, 0.05);
    }
  }
}

/* 通用标题样式 */
.section-title {
  font-size: 18px;
  font-weight: 600;
  color: #333333;
  margin: 24px 20px 16px;
}

/* 本月挑战卡片 */
.monthly-challenge-section {
  margin: 20px;

  .challenge-card {
    background: linear-gradient(135deg, #E3F2FD, #BBDEFB);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    align-items: center;
    gap: 20px;
    box-shadow: 0 4px 16px rgba(187, 222, 251, 0.3);

    .challenge-left {
      .progress-circle {
        position: relative;
        width: 80px;
        height: 80px;

        .progress-ring {
          width: 100%;
          height: 100%;
          border-radius: 50%;
          background: conic-gradient(#FFB347 0deg, #FFB347 0deg, #E0E0E0 0deg, #E0E0E0 360deg);
          display: flex;
          align-items: center;
          justify-content: center;

          .progress-fill {
            width: 60px;
            height: 60px;
            border-radius: 50%;
            background: #FFFFFF;
            transition: transform 0.3s ease;
          }
        }

        .progress-text {
          position: absolute;
          top: 50%;
          left: 50%;
          transform: translate(-50%, -50%);
          font-size: 16px;
          font-weight: bold;
          color: #333333;
        }
      }
    }

    .challenge-right {
      flex: 1;
      display: flex;
      flex-direction: column;
      gap: 12px;

      .challenge-badge {
        width: 60px;
        height: 60px;
        border-radius: 12px;
        overflow: hidden;
        box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

        image {
          width: 100%;
          height: 100%;
        }
      }

      .challenge-info {
        .challenge-title {
          font-size: 18px;
          font-weight: bold;
          color: #333333;
          margin-bottom: 4px;
        }

        .challenge-description {
          font-size: 14px;
          color: #666666;
          margin-bottom: 8px;
        }

        .challenge-participants {
          font-size: 12px;
          color: #888888;
        }
      }

      .challenge-action {
        align-self: flex-start;
      }
    }
  }
}

/* 排行榜模块 */
.leaderboard-section {
  margin: 0 20px;

  .leaderboard-tabs {
    display: flex;
    background: #FFFFFF;
    border-radius: 12px;
    margin-bottom: 16px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    .tab-item {
      flex: 1;
      text-align: center;
      padding: 16px 12px;
      font-size: 14px;
      color: #888888;
      transition: all 0.3s ease;
      position: relative;

      &.active {
        background: #FFF8E1;
        color: #FFB347;
        font-weight: 600;

        &::after {
          content: '';
          position: absolute;
          bottom: 0;
          left: 50%;
          transform: translateX(-50%);
          width: 20px;
          height: 3px;
          background: #FFB347;
          border-radius: 2px;
        }
      }

      &:active {
        background: #FFF3E0;
      }
    }
  }

  .leaderboard-list {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);

    .leaderboard-item {
      display: flex;
      align-items: center;
      padding: 16px 0;
      border-bottom: 1px solid #F0F0F0;
      transition: all 0.3s ease;

      &:last-child {
        border-bottom: none;
      }

      &:active {
        background: #FAFAFA;
        border-radius: 8px;
        margin: 0 -8px;
        padding: 16px 8px;
      }

      .rank-number {
        width: 36px;
        height: 36px;
        background: #E0E0E0;
        color: #666666;
        border-radius: 50%;
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 14px;
        font-weight: 600;
        margin-right: 16px;

        &.top-1 {
          background: linear-gradient(135deg, #FFD700, #FFA500);
          color: #FFFFFF;
        }

        &.top-2 {
          background: linear-gradient(135deg, #C0C0C0, #A0A0A0);
          color: #FFFFFF;
        }

        &.top-3 {
          background: linear-gradient(135deg, #CD7F32, #B8860B);
          color: #FFFFFF;
        }
      }

      .user-avatar {
        width: 44px;
        height: 44px;
        border-radius: 50%;
        margin-right: 16px;
        border: 2px solid #F0F0F0;
      }

      .user-info {
        flex: 1;

        .user-nickname {
          font-size: 16px;
          font-weight: 600;
          color: #333333;
          margin-bottom: 4px;
        }

        .user-score {
          font-size: 14px;
          color: #888888;
        }
      }

      .user-badges {
        display: flex;
        gap: 4px;

        .badge-icon {
          width: 24px;
          height: 24px;
          border-radius: 50%;
        }
      }
    }
  }
}

/* 奖励区 */
.rewards-section {
  margin: 0 20px;

  .rewards-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 16px;

    .reward-card {
      background: #FFFFFF;
      border-radius: 12px;
      padding: 16px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
      transition: all 0.3s ease;

      &:active {
        transform: scale(0.98);
      }

      .reward-image {
        width: 100%;
        height: 120px;
        border-radius: 8px;
        margin-bottom: 12px;
        background: #F5F5F5;
      }

      .reward-info {
        margin-bottom: 12px;

        .reward-name {
          font-size: 16px;
          font-weight: 600;
          color: #333333;
          margin-bottom: 4px;
        }

        .reward-description {
          font-size: 12px;
          color: #888888;
          line-height: 1.4;
        }
      }

      .reward-status {
        font-size: 12px;
        padding: 4px 8px;
        border-radius: 12px;
        text-align: center;
        background: #F0F0F0;
        color: #888888;

        &.earned {
          background: #E8F5E8;
          color: #4CAF50;
        }
      }
    }
  }
}

/* 历史活动滑动区 */
.history-section {
  margin: 0 20px;

  .history-scroll {
    white-space: nowrap;
  }

  .history-container {
    display: inline-flex;
    gap: 16px;
    padding-right: 20px;
  }

  .history-card {
    background: #FFFFFF;
    border-radius: 12px;
    padding: 16px;
    min-width: 140px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;

    &:active {
      transform: scale(0.95);
    }

    .history-badge {
      width: 60px;
      height: 60px;
      border-radius: 12px;
      overflow: hidden;
      margin: 0 auto 12px;
      box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

      image {
        width: 100%;
        height: 100%;
      }
    }

    .history-info {
      text-align: center;
      margin-bottom: 8px;

      .history-title {
        font-size: 14px;
        font-weight: 600;
        color: #333333;
        margin-bottom: 4px;
        white-space: normal;
        line-height: 1.3;
      }

      .history-date {
        font-size: 12px;
        color: #888888;
      }
    }

    .history-participants {
      font-size: 12px;
      color: #FFB347;
      text-align: center;
      font-weight: 500;
    }
  }
}
